﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Threading;
using System.IO;
using System.Web;
using Microsoft.CSharp;
using System.Windows.Forms;

namespace NFinal.HttpServer
{
    class Program
    {
        public static HttpHandlerServer httpHandlerServer = null;
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main(string[] args)
        {
            foreach (var arg in args)
            {
                Console.WriteLine(arg);
            }
            string WebApplicationRoot = AppDomain.CurrentDomain.BaseDirectory;
            string WebApplicationBin = Path.Combine(WebApplicationRoot, "Bin"+Path.DirectorySeparatorChar);
            httpHandlerServer = new HttpHandlerServer(true,
                WebApplicationRoot,
                WebApplicationBin);
            Console.WriteLine("服务器开始启动");
            httpHandlerServer.Start("http://localhost:8080/");
            System.Diagnostics.Process.Start("http://localhost:8080" + "/Index.aspx");
            Console.ReadLine();
            httpHandlerServer.Stop();
        }
    }
}
